package bluerain.io.adapter.ui;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

import bluerain.io.adapter.R;

/**
 * Created by foredawn on 15-9-12.
 * Spinner的基本用法
 */
public class SpinnerActivityTest extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.spinner_test);
        Spinner spinner = (Spinner) findViewById(R.id.noEntriesSpinner);
        String[] array = new String[]{"猪八戒", "孙悟空", "唐三藏"};
        ArrayAdapter<String> adapter = new ArrayAdapter<>(
                this, R.layout.support_simple_spinner_dropdown_item, array
        );
        spinner.setAdapter(adapter);
    }
}
